Repository navigation
Show traffic freshness in the catalog pulse - #11
Merged
Merged
Conversation
Co-authored-by: CommandCodeBot <[email protected]>
The pulse could freeze silently whenever GitHub's traffic feed lagged past its usual ~1-2 day settle, and the chart gave no way to tell a stalled feed from an idle catalog. Report the newest day with recorded traffic under the chart, and warn once the feed is more than two days behind. Co-authored-by: CommandCodeBot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
O que muda
O gráfico "Last 14 days" ganhou um indicador de frescor abaixo do título:
Data through Sep 27.GitHub has not published new traffic since Sep 23 (5 days behind).em tom de avisoNo traffic recorded in this window yet.Por quê
Quando a API de tráfego do GitHub estaciona além do settle usual (~1–2 dias), o pulse congelava em silêncio e ficava indistinguível de um bug do app — foi exatamente o que aconteceu nos últimos dias (GitHub sem publicar nada depois de 23/set). Agora a própria UI diz até que dia os dados chegam.
Como foi feito
trafficFreshness()emweb/src/lib/trafficCharts.js— helper puro que reporta o último dia com tráfego, quantos dias de atraso e o estadostaletrafficCharts.test.js(3 casos) eCatalogCharts.test.js(2 casos, com fake timers)CatalogCharts.svelte+ estilos.chart-freshnessematlas.cssVerificação
npm run test:fe— 47 testes passandomake ci— race tests, golangci-lint 0 issues, prettier okcais test— ok